/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.ing.sisval.gui;

import java.awt.Desktop;
import java.awt.Image;
import java.awt.Toolkit;
import java.io.File;
import javax.swing.JInternalFrame;
import net.sf.jasperreports.engine.util.JRLoader;
import org.ing.sisval.be.BEPersona;
import org.ing.sisval.gui.control.JIFAdministrarComplementario;
import org.ing.sisval.gui.control.JIFAdministrarDepreciacion;
import org.ing.sisval.gui.control.JIFAdministrarDistribucion;
import org.ing.sisval.gui.control.JIFAdministrarInfraestructura;
import org.ing.sisval.gui.control.JIFAsignarDistribucion;
import org.ing.sisval.gui.control.JIFAsignarInfraestructura;
import org.ing.sisval.gui.control.JIFAdministrarPropiedad;
import org.ing.sisval.gui.control.JIFAdministrarUnitario;
import org.ing.sisval.gui.control.JIFAsignarEspecificaciónTecnica;
import org.ing.sisval.gui.control.JIFEspecificacionTecnica;
import org.ing.sisval.gui.control.JIFValuacionComplementaria;
import org.ing.sisval.gui.control.JIFValuacionEdificacion;
import org.ing.sisval.gui.control.JIFValuacionTerreno;
import org.ing.sisval.gui.reportes.JIFReportePropiedadComercial;
import org.ing.sisval.gui.seguridad.JIFAdministrarPersona;
import org.rx.cr.db.DBA;
import org.rx.cr.conf.Config;
import org.rx.cr.gui.DesktopPanel;
import org.rx.cr.util.Utilitarios;
import static org.rx.cr.util.Utilitarios.centreaVentana;
import static org.rx.cr.util.Utilitarios.maximizarAbsoluta;
import static org.rx.cr.util.Utilitarios.setIconoVentana;

/**
 *
 * @author Mysham
 */
public final class JFPrincipal extends javax.swing.JFrame {

    private DesktopPanel desktopPanel;

    public JIFAdministrarComplementario administrarComplementario;
    public JIFAdministrarDepreciacion administrarDepreciacion;
    public JIFAdministrarPropiedad administrarPropiedad;
    public JIFAdministrarUnitario administrarUnitario;
    public JIFValuacionComplementaria valuacionComplementaria;
    public JIFValuacionEdificacion valuacionEdificacion;
    public JIFValuacionTerreno valuacionTerreno;
    public JIFAsignarDistribucion jifAsignarDistribucion;
    public JIFAsignarInfraestructura jifAsignarInfraestructura;
    public JIFEspecificacionTecnica jifEspecificacionTecnica;
    public JIFAsignarEspecificaciónTecnica jifAsignarEspecificaciónTecnica;
    public JIFAdministrarInfraestructura jifAdministrarInfraestructura;
    public JIFAdministrarDistribucion jifAdministrarDistribucion;
    public JIFReportePropiedadComercial jifReportePropiedadComercial;
    public JIFAdministrarPersona jifAdministrarPersona;

    private Config conf;
    private BEPersona personal_logueado;

    public JFPrincipal(Config conf) {
        DBA.selectMYSQL();
        initComponents();
        setConf(conf);

        administrarComplementario = new JIFAdministrarComplementario(this);
        administrarDepreciacion = new JIFAdministrarDepreciacion(this);
        administrarPropiedad = new JIFAdministrarPropiedad(this);
        administrarUnitario = new JIFAdministrarUnitario(this);
        valuacionComplementaria = new JIFValuacionComplementaria(this);
        valuacionEdificacion = new JIFValuacionEdificacion(this);
        valuacionTerreno = new JIFValuacionTerreno(this);
        jifAsignarDistribucion = new JIFAsignarDistribucion(this);
        jifAsignarInfraestructura = new JIFAsignarInfraestructura(this);
        jifEspecificacionTecnica = new JIFEspecificacionTecnica(this);
        jifAsignarEspecificaciónTecnica = new JIFAsignarEspecificaciónTecnica(this);
        jifAdministrarDistribucion = new JIFAdministrarDistribucion(this);
        jifAdministrarInfraestructura = new JIFAdministrarInfraestructura(this);
        jifReportePropiedadComercial = new JIFReportePropiedadComercial(this);
        jifAdministrarPersona = new JIFAdministrarPersona(this);

        desktopPanel = new DesktopPanel();
        setIconoVentana(this, "/org/ing/sisval/imagen/Dollar.png");
        
        desktopPanel.setAppName("SISVAL");

        desktopPanel.setDesktopBackground("/org/ing/sisval/imagen/Fondo.png");
        jPanel1.add(desktopPanel);
        this.setTitle("SISTEMA DE VALUACIÓN DE PREDIOS - SISVAL v. 1.0");

        maximizarAbsoluta(this);
        centreaVentana(this);

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollBar1 = new javax.swing.JScrollBar();
        jMenuItem7 = new javax.swing.JMenuItem();
        jPanel1 = new javax.swing.JPanel();
        jToolBar1 = new javax.swing.JToolBar();
        jButton1 = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JToolBar.Separator();
        jButton11 = new javax.swing.JButton();
        jButton12 = new javax.swing.JButton();
        jButton13 = new javax.swing.JButton();
        jSeparator5 = new javax.swing.JToolBar.Separator();
        jButton2 = new javax.swing.JButton();
        jSeparator6 = new javax.swing.JToolBar.Separator();
        jButton3 = new javax.swing.JButton();
        jSeparator7 = new javax.swing.JToolBar.Separator();
        jButton10 = new javax.swing.JButton();
        jToolBar2 = new javax.swing.JToolBar();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jSeparator10 = new javax.swing.JToolBar.Separator();
        jButton7 = new javax.swing.JButton();
        jButton8 = new javax.swing.JButton();
        jButton9 = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jmHardware = new javax.swing.JMenu();
        jMenuItem2 = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        jMenuItem1 = new javax.swing.JMenuItem();
        jmiEquipoComputo = new javax.swing.JMenuItem();
        jmiEquipo = new javax.swing.JMenuItem();
        jSeparator3 = new javax.swing.JPopupMenu.Separator();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenuItem6 = new javax.swing.JMenuItem();
        jmSoftware = new javax.swing.JMenu();
        jmiSoftwareAplicativo = new javax.swing.JMenuItem();
        jmiSoftwareEstatal = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jmEstablecimiento = new javax.swing.JMenu();
        jmiUsuarios1 = new javax.swing.JMenuItem();
        jmSeguridad = new javax.swing.JMenu();
        jmiUsuarios = new javax.swing.JMenuItem();
        jmAyuda = new javax.swing.JMenu();
        jmiInformacion = new javax.swing.JMenuItem();
        jmSalir = new javax.swing.JMenu();
        jmiSalir = new javax.swing.JMenuItem();

        jMenuItem7.setText("jMenuItem7");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel1.setLayout(new java.awt.BorderLayout());

        jToolBar1.setFloatable(false);
        jToolBar1.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jToolBar1.setRollover(true);
        jToolBar1.setOpaque(false);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/administrar_1.png"))); // NOI18N
        jButton1.setToolTipText("Administrar propiedad");
        jButton1.setFocusable(false);
        jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton1.setMaximumSize(new java.awt.Dimension(60, 60));
        jButton1.setOpaque(false);
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton1);
        jToolBar1.add(jSeparator2);

        jButton11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/mapa.png"))); // NOI18N
        jButton11.setToolTipText("Valuación de terreno");
        jButton11.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jButton11.setFocusable(false);
        jButton11.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton11.setMaximumSize(new java.awt.Dimension(60, 60));
        jButton11.setOpaque(false);
        jButton11.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton11ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton11);

        jButton12.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/edificioV.jpg"))); // NOI18N
        jButton12.setToolTipText("Valuación de edificación");
        jButton12.setFocusable(false);
        jButton12.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton12.setMaximumSize(new java.awt.Dimension(60, 60));
        jButton12.setOpaque(false);
        jButton12.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton12ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton12);

        jButton13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/Vcomplementario.png"))); // NOI18N
        jButton13.setToolTipText("Valuación complementaria");
        jButton13.setFocusable(false);
        jButton13.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton13.setMaximumSize(new java.awt.Dimension(60, 60));
        jButton13.setOpaque(false);
        jButton13.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton13ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton13);
        jToolBar1.add(jSeparator5);

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/Informe.png"))); // NOI18N
        jButton2.setToolTipText("Informe pericial");
        jButton2.setFocusable(false);
        jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton2.setMaximumSize(new java.awt.Dimension(60, 60));
        jButton2.setMinimumSize(new java.awt.Dimension(60, 60));
        jButton2.setOpaque(false);
        jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton2);
        jToolBar1.add(jSeparator6);

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/Locker_opt.png"))); // NOI18N
        jButton3.setToolTipText("Administración de usuario");
        jButton3.setFocusable(false);
        jButton3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton3.setMaximumSize(new java.awt.Dimension(60, 60));
        jButton3.setOpaque(false);
        jButton3.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton3);
        jToolBar1.add(jSeparator7);

        jButton10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/Exit.png"))); // NOI18N
        jButton10.setToolTipText("Salir");
        jButton10.setFocusable(false);
        jButton10.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton10.setMaximumSize(new java.awt.Dimension(60, 60));
        jButton10.setOpaque(false);
        jButton10.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton10ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton10);

        jPanel1.add(jToolBar1, java.awt.BorderLayout.LINE_START);

        jToolBar2.setFloatable(false);
        jToolBar2.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jToolBar2.setRollover(true);
        jToolBar2.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/administrarVU_1.png"))); // NOI18N
        jButton4.setToolTipText("Administración de valor unitario");
        jButton4.setFocusable(false);
        jButton4.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton4.setMaximumSize(new java.awt.Dimension(60, 60));
        jButton4.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });
        jToolBar2.add(jButton4);

        jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/administrarVC_2.png"))); // NOI18N
        jButton5.setToolTipText("Administración de valor complementario");
        jButton5.setFocusable(false);
        jButton5.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton5.setMaximumSize(new java.awt.Dimension(60, 60));
        jButton5.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });
        jToolBar2.add(jButton5);

        jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/administrarVD_3.png"))); // NOI18N
        jButton6.setToolTipText("Administración de valor de depreciación");
        jButton6.setFocusable(false);
        jButton6.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton6.setMaximumSize(new java.awt.Dimension(60, 60));
        jButton6.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });
        jToolBar2.add(jButton6);
        jToolBar2.add(jSeparator10);

        jButton7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/administrarET_4.png"))); // NOI18N
        jButton7.setToolTipText("Administración de especificación técnica");
        jButton7.setFocusable(false);
        jButton7.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton7.setMaximumSize(new java.awt.Dimension(60, 60));
        jButton7.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });
        jToolBar2.add(jButton7);

        jButton8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/administrarI_5.png"))); // NOI18N
        jButton8.setToolTipText("Administración de infraestructura");
        jButton8.setFocusable(false);
        jButton8.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton8.setMaximumSize(new java.awt.Dimension(60, 60));
        jButton8.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });
        jToolBar2.add(jButton8);

        jButton9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/administrarT_6.png"))); // NOI18N
        jButton9.setToolTipText("Administración de distribución");
        jButton9.setFocusable(false);
        jButton9.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton9.setMaximumSize(new java.awt.Dimension(60, 60));
        jButton9.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton9ActionPerformed(evt);
            }
        });
        jToolBar2.add(jButton9);

        jPanel1.add(jToolBar2, java.awt.BorderLayout.LINE_END);

        jmHardware.setText("Administrar");

        jMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/administrar.png"))); // NOI18N
        jMenuItem2.setText("Administración de propiedad");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        jmHardware.add(jMenuItem2);
        jmHardware.add(jSeparator1);

        jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/administrarVU.png"))); // NOI18N
        jMenuItem1.setText("Administración de valor unitario de edificación");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jmHardware.add(jMenuItem1);

        jmiEquipoComputo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/administrarVC.png"))); // NOI18N
        jmiEquipoComputo.setText("Administración de valor complementario");
        jmiEquipoComputo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiEquipoComputoActionPerformed(evt);
            }
        });
        jmHardware.add(jmiEquipoComputo);

        jmiEquipo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/administrarVD.png"))); // NOI18N
        jmiEquipo.setText("Administración de  valor de depreciacion");
        jmiEquipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiEquipoActionPerformed(evt);
            }
        });
        jmHardware.add(jmiEquipo);
        jmHardware.add(jSeparator3);

        jMenuItem4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/administrarET.png"))); // NOI18N
        jMenuItem4.setText("Administración de especificación técnica");
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem4ActionPerformed(evt);
            }
        });
        jmHardware.add(jMenuItem4);

        jMenuItem5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/administrarI.png"))); // NOI18N
        jMenuItem5.setText("Administración de infraestructura");
        jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem5ActionPerformed(evt);
            }
        });
        jmHardware.add(jMenuItem5);

        jMenuItem6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/administrarT.png"))); // NOI18N
        jMenuItem6.setText("Administracón de distribución");
        jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem6ActionPerformed(evt);
            }
        });
        jmHardware.add(jMenuItem6);

        jMenuBar1.add(jmHardware);

        jmSoftware.setText("Valorizacion Reglamentaria");

        jmiSoftwareAplicativo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/mapa.png"))); // NOI18N
        jmiSoftwareAplicativo.setText("Valuación de Terreno");
        jmiSoftwareAplicativo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiSoftwareAplicativoActionPerformed(evt);
            }
        });
        jmSoftware.add(jmiSoftwareAplicativo);

        jmiSoftwareEstatal.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/edificioV_1.jpg"))); // NOI18N
        jmiSoftwareEstatal.setText("Valuación de Edificaciones");
        jmiSoftwareEstatal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiSoftwareEstatalActionPerformed(evt);
            }
        });
        jmSoftware.add(jmiSoftwareEstatal);

        jMenuItem3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/Vcomplementario.jpg"))); // NOI18N
        jMenuItem3.setText("Valuación Complementaria");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        jmSoftware.add(jMenuItem3);

        jMenuBar1.add(jmSoftware);

        jmEstablecimiento.setText("Informe pericial");

        jmiUsuarios1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/Informe_1.png"))); // NOI18N
        jmiUsuarios1.setText("Informe pericial");
        jmiUsuarios1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiUsuarios1ActionPerformed(evt);
            }
        });
        jmEstablecimiento.add(jmiUsuarios1);

        jMenuBar1.add(jmEstablecimiento);

        jmSeguridad.setText("Seguridad");

        jmiUsuarios.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/Locker_opt_1.png"))); // NOI18N
        jmiUsuarios.setText("Administracón de usuario");
        jmiUsuarios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiUsuariosActionPerformed(evt);
            }
        });
        jmSeguridad.add(jmiUsuarios);

        jMenuBar1.add(jmSeguridad);

        jmAyuda.setText("Ayuda");

        jmiInformacion.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/Book.png"))); // NOI18N
        jmiInformacion.setText("Manual de usuario");
        jmiInformacion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiInformacionActionPerformed(evt);
            }
        });
        jmAyuda.add(jmiInformacion);

        jMenuBar1.add(jmAyuda);

        jmSalir.setText("Salir");

        jmiSalir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK));
        jmiSalir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/ing/sisval/imagen/Exit_1.png"))); // NOI18N
        jmiSalir.setText("Salir");
        jmiSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiSalirActionPerformed(evt);
            }
        });
        jmSalir.add(jmiSalir);

        jMenuBar1.add(jmSalir);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 747, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jmiSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiSalirActionPerformed
        Utilitarios.salir(this);
    }//GEN-LAST:event_jmiSalirActionPerformed

    private void jmiEquipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiEquipoActionPerformed
        insertarInternalFrame(administrarDepreciacion);
    }//GEN-LAST:event_jmiEquipoActionPerformed

    private void jmiEquipoComputoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiEquipoComputoActionPerformed
        insertarInternalFrame(administrarComplementario);
    }//GEN-LAST:event_jmiEquipoComputoActionPerformed

    private void jmiSoftwareAplicativoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiSoftwareAplicativoActionPerformed
        insertarInternalFrame(valuacionTerreno);
    }//GEN-LAST:event_jmiSoftwareAplicativoActionPerformed

    private void jmiSoftwareEstatalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiSoftwareEstatalActionPerformed
        // TODO add your handling code here:
        insertarInternalFrame(valuacionEdificacion);
    }//GEN-LAST:event_jmiSoftwareEstatalActionPerformed

    private void jmiInformacionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiInformacionActionPerformed
        // TODO add your handling code here:
        try {
            manual();
        } catch (Exception e) {
            System.out.println("Error al mostrar manual. " + e);
        }

    }//GEN-LAST:event_jmiInformacionActionPerformed

    private void jmiUsuariosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiUsuariosActionPerformed
        // TODO add your handling code here:
        insertarInternalFrame(jifAdministrarPersona);
    }//GEN-LAST:event_jmiUsuariosActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        insertarInternalFrame(administrarUnitario);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        insertarInternalFrame(administrarPropiedad);
    }//GEN-LAST:event_jMenuItem2ActionPerformed

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        insertarInternalFrame(valuacionComplementaria);
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
        // TODO add your handling code here:
        insertarInternalFrame(jifEspecificacionTecnica);
    }//GEN-LAST:event_jMenuItem4ActionPerformed

    private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
        // TODO add your handling code here:
        insertarInternalFrame(jifAdministrarInfraestructura);
    }//GEN-LAST:event_jMenuItem5ActionPerformed

    private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
        // TODO add your handling code here:
        insertarInternalFrame(jifAdministrarDistribucion);
    }//GEN-LAST:event_jMenuItem6ActionPerformed

    private void jmiUsuarios1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiUsuarios1ActionPerformed
        // TODO add your handling code here:
        insertarInternalFrame(jifReportePropiedadComercial);
    }//GEN-LAST:event_jmiUsuarios1ActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
        insertarInternalFrame(jifEspecificacionTecnica);
    }//GEN-LAST:event_jButton7ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        insertarInternalFrame(administrarPropiedad);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        insertarInternalFrame(administrarUnitario);
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        insertarInternalFrame(administrarComplementario);
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        insertarInternalFrame(administrarDepreciacion);
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
        insertarInternalFrame(jifAdministrarInfraestructura);
    }//GEN-LAST:event_jButton8ActionPerformed

    private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
        insertarInternalFrame(jifAdministrarDistribucion);
    }//GEN-LAST:event_jButton9ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        insertarInternalFrame(jifReportePropiedadComercial);
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed

        insertarInternalFrame(jifAdministrarPersona);
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
        Utilitarios.salir(this);
    }//GEN-LAST:event_jButton10ActionPerformed

    private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton11ActionPerformed
        insertarInternalFrame(valuacionTerreno);
    }//GEN-LAST:event_jButton11ActionPerformed

    private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton12ActionPerformed
        insertarInternalFrame(valuacionEdificacion);
    }//GEN-LAST:event_jButton12ActionPerformed

    private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed
        insertarInternalFrame(valuacionComplementaria);
    }//GEN-LAST:event_jButton13ActionPerformed

    /**
     * @param args the command line arguments
     */

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton11;
    private javax.swing.JButton jButton12;
    private javax.swing.JButton jButton13;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollBar jScrollBar1;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JToolBar.Separator jSeparator10;
    private javax.swing.JToolBar.Separator jSeparator2;
    private javax.swing.JPopupMenu.Separator jSeparator3;
    private javax.swing.JToolBar.Separator jSeparator5;
    private javax.swing.JToolBar.Separator jSeparator6;
    private javax.swing.JToolBar.Separator jSeparator7;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JToolBar jToolBar2;
    private javax.swing.JMenu jmAyuda;
    private javax.swing.JMenu jmEstablecimiento;
    private javax.swing.JMenu jmHardware;
    private javax.swing.JMenu jmSalir;
    private javax.swing.JMenu jmSeguridad;
    private javax.swing.JMenu jmSoftware;
    private javax.swing.JMenuItem jmiEquipo;
    private javax.swing.JMenuItem jmiEquipoComputo;
    private javax.swing.JMenuItem jmiInformacion;
    private javax.swing.JMenuItem jmiSalir;
    private javax.swing.JMenuItem jmiSoftwareAplicativo;
    private javax.swing.JMenuItem jmiSoftwareEstatal;
    private javax.swing.JMenuItem jmiUsuarios;
    private javax.swing.JMenuItem jmiUsuarios1;
    // End of variables declaration//GEN-END:variables

    public void insertarInternalFrame(JInternalFrame jif) {
        desktopPanel.insertarInternalFrame(jif);
        jif.setVisible(true);
        jif.setEnabled(true);

    }

    @Override
    public Image getIconImage() {
        Image retValue = Toolkit.getDefaultToolkit().
                getImage(ClassLoader.getSystemResource("org.ing.sisval.imagen/ima.png"));
        return retValue;

    }

    public Config getConf() {
        return conf;
    }

    public void setConf(Config conf) {
        this.conf = conf;
    }

    public BEPersona getPersonal_logueado() {
        return personal_logueado;
    }

    public void setPersonal_logueado(BEPersona personal_logueado) {
        this.personal_logueado = personal_logueado;
    }

    public void manual() {
        try {
            File file = new File(getClass().getResource("/org/ing/sisval/util/Manual.pdf").getFile());
            Desktop.getDesktop().open(file);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
